package re;

import nfa.NFADesign;
import nfa.NFARulebook;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

/**
 * @author haoly
 * @title Empty
 * @date 2025/4/17 08:48
 * @description 空正则表达式
 */
public class Empty extends Pattern{
    @Override
    public int precedence() {
        return 3;
    }

    @Override
    public String toString() {
        return "";
    }

    @Override
    public NFADesign toNFADesign(){
        Object startState = new Object();
        Set acceptStates = new HashSet();
        acceptStates.add(startState);
        NFARulebook rulebook = new NFARulebook(new ArrayList<>());
        return new NFADesign(startState, acceptStates, rulebook);
    }
}
